<ng-container *ngIf="!outlet.isActivated">
    <div tsTabs class="card">
        <div>
            <div class="toolbar">
                <!-- <h4>初期库存</h4> -->
                <div class="input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text bg-white">商品名称</span>
                    </div>
                    <input [(ngModel)]="search.params.name" type="text" class="form-control" placeholder="请输入商品名称关键词">
                    <div class="input-group-prepend input-group-append">
                        <span class="input-group-text bg-white">条形码</span>
                    </div>
                    <input [(ngModel)]="search.params.account" type="text" class="form-control" placeholder="请输入关键词">
                </div>
                <br>
                <div class="row">
                    <div class="col-6">
                        <div class="input-group">
                            <div class="input-group-prepend">
                                <span class="input-group-text bg-white">共查询到</span>
                            </div>
                            <input type="text" value="{{pagination.total}}" class="form-control text-center bg-white" readonly placeholder="0">
                            <div class="input-group-append">
                                <span class="input-group-text bg-white">条/结果</span>
                            </div>
                        </div>
                    </div>
                    <div class="col-6 text-right m-btn">
                        <button class="btn btn-success" (click)="showEditModal()">
                            <span>添加库存</span>
                        </button>
                        <button (click)="doReset()" class="btn btn-white">
                            <i class="iconfont icon-refresh mr-1"></i>
                            <span>重置</span>
                        </button>
                        <button (click)="doSearch()" class="btn btn-white">
                            <i class="iconfont icon-search mr-1"></i>
                            <span>搜索</span>
                        </button>
                        <button class="btn btn-white">
                            <span>导入</span>
                        </button>
                    </div>
                </div>
            </div>
            <div class="p-2">
                <div class="card rounded-0 mt-2">
                    <div class="card-body">
                        <h4 style="font-size: 1.1rem;font-weight:400;" class="mt-5 mb-5 text-center">期初库存</h4>
                        <ts-table-load [display]="loading"></ts-table-load>
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <tbody>
                                    <tr class="font-weight-bold bg-light">
                                        <td *ngFor="let th of theads">{{th}}</td>
                                    </tr>
                                    <tr *ngFor="let td of list" >
                                        <td>{{td.id}}</td>
                                        <td>{{td.beginOfPeriodOrderNumber}}</td>
                                        <td>{{td.warehouseId}}</td>
                                        <td>{{td.beginOfPeriodDate.substring(0,10)|date:'yyyy/MM/dd'}}</td>
                                        <td>{{td.goodsVarietiesNumber}}</td>
                                         <td>{{td.goodsTotalBoxesNumber}}</td>
                                         <td>{{td.reportManId}}</td>

                                        <td>
                                            <span (click)="confirmDelete(td.id)" class="btn-icon btn-icon-danger">
                                                <i class="iconfont icon-delete"></i>
                                            </span>
                                            <span class="btn-icon btn-icon-info" (click)="showEditModal(td)">
                                                <i class="iconfont icon-edit"></i>
                                            </span>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="text-right">
                            <ts-pagination (pageChange)="loadDatas()" [pagination]="pagination" [items]="[{text:'显示 5 条',value:5},{text:'显示 10 条',value:10},{text:'显示 20 条',value:20}]"
                                [color]="global.params.color" goTitle="跳转" prevTitle="上一页" nextTitle="下一页" startTitle="首页" endTitle="末尾"
                                outline></ts-pagination>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div>
            <div class="p-2">
                <div class="card rounded-0 mt-2">
                    <div class="card-body">
                        <h4 style="font-size: 1.1rem;font-weight:400;" class="mt-5 mb-5 text-center">商品明细</h4>
                        <ts-table-load [display]="loading"></ts-table-load>
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <tbody>
                                    <tr class="font-weight-bold bg-light">
                                        <td *ngFor="let th of theadtwo">{{th}}</td>
                                    </tr>
                                    <tr *ngFor="let td of list">
                                        <td>{{td.id}}</td>
                                        <td>
                                            <img tsImg [src]="td.companyLogo" dataSrc="assets/images/404.jpg" class="rounded-circle" width="40" height="40" alt="Logo">
                                        </td>
                                        <td>{{td.companyName}}</td>
                                        <td>{{td.companyManagerAccount}}</td>
                                        <td>{{td.companyManagerMobile}}</td>
                                        <td>{{td.createdAt.substring(0,10)|date:'yyyy/MM/dd'}}</td>
                                        <td>
                                            <span *ngIf="td.isActive===1" class="badge badge-success badge-pill">启用</span>
                                            <span *ngIf="td.isActive!==1" class="badge badge-secondary badge-pill">停用</span>
                                        </td>
                                        <td>
                                            <span (click)="confirmDelete(td)" class="btn-icon btn-icon-danger">
                                                <i class="iconfont icon-delete"></i>
                                            </span>
                                            <span class="btn-icon btn-icon-info" routerLink="detail/{{td.id}}">
                                                <i class="iconfont icon-edit"></i>
                                            </span>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="text-right">
                            <ts-pagination (pageChange)="loadDatas()" [pagination]="pagination" [items]="[{text:'显示 5 条',value:5},{text:'显示 10 条',value:10},{text:'显示 20 条',value:20}]"
                                [color]="global.params.color" goTitle="跳转" prevTitle="上一页" nextTitle="下一页" startTitle="首页" endTitle="末尾"
                                outline></ts-pagination>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</ng-container>
<router-outlet #outlet="outlet"></router-outlet>